Skip to content

fix(opentelemetry-sdk-node): the custom value from env variable for service.instance.id should take priority over random uuid as backup#6345

Merged
maryliag merged 8 commits intoopen-telemetry:mainfrom
maryliag:fix-service-id
Jan 28, 2026
Merged

fix(opentelemetry-sdk-node): the custom value from env variable for service.instance.id should take priority over random uuid as backup#6345
maryliag merged 8 commits intoopen-telemetry:mainfrom
maryliag:fix-service-id

Conversation

@maryliag
Copy link
Copy Markdown
Contributor

@maryliag maryliag commented Jan 28, 2026

The service-instance.id was being set as random uuid, even when there were a custom value on env variable.

This PR fixes the correct priority, having the environment detector for last.

@maryliag maryliag requested a review from a team as a code owner January 28, 2026 17:02
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.68%. Comparing base (f1c135c) to head (6954ab3).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6345      +/-   ##
==========================================
+ Coverage   95.67%   95.68%   +0.01%     
==========================================
  Files         313      313              
  Lines        9667     9667              
  Branches     2226     2226              
==========================================
+ Hits         9249     9250       +1     
+ Misses        418      417       -1     
Files with missing lines Coverage Δ
...ental/packages/opentelemetry-sdk-node/src/utils.ts 95.51% <ø> (+0.44%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown

@grcevski grcevski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for fixing this @maryliag !

@maryliag maryliag changed the title fix(opentelemetry-resources): the custom value from env variable for service.instance.id should take priority over random uuid as backup fix(opentelemetry-sdk-node): the custom value from env variable for service.instance.id should take priority over random uuid as backup Jan 28, 2026
@maryliag maryliag added this pull request to the merge queue Jan 28, 2026
Merged via the queue into open-telemetry:main with commit 722552f Jan 28, 2026
27 checks passed
@maryliag maryliag deleted the fix-service-id branch January 28, 2026 19:32
trentm added a commit to trentm/opentelemetry-js that referenced this pull request Jan 28, 2026
This actually results in the single-quotes being part of the value.

      resource: Resource {
        attributes: [
          KeyValue { key: 'service.instance.id', value: AnyValue { stringValue: "'custom-name'" } },
          ...

Refs: open-telemetry#6345
@trentm
Copy link
Copy Markdown
Contributor

trentm commented Jan 28, 2026

@maryliag
Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants